<template>
    <div class="paper-mamual">
        <div class="paper-mamual--header">
            <span>已选：9</span>
            <span>单选题：3</span>
            <span>多选题：2</span>
            <span>商品归类题：2</span>
        </div>
        <div class="paper-mamual--content">
            <Form inline :label-width="5">
                <FormItem>
                    <Input
                        v-model="params.type1"
                        placeholder="题干"
                    ></Input>
                </FormItem>
                <FormItem>
                    <Select
                        v-model="params.type1"
                        placeholder="所属分类"
                        style="width:100px"
                        clearable
                    >
                    </Select>
                </FormItem>
                <FormItem>
                    <Select
                        v-model="params.type1"
                        placeholder="题型"
                        style="width:100px"
                        clearable
                    >
                    </Select>
                </FormItem>
                <FormItem>
                    <Select
                        v-model="params.type1"
                        placeholder="难度"
                        style="width:100px"
                        clearable
                    >
                    </Select>
                </FormItem>
                <FormItem>
                    <Button type="primary" @click="search">搜索</Button>
                </FormItem>
                <FormItem>
                    <Button @click="clearSearch">清空</Button>
                </FormItem>
            </Form>
            <Table :data="list" :columns="columns"></Table>
        </div>
    </div>
</template>
<script>
import { questionList } from '@/api/questionManage'
export default {
    data () {
        return {
            list: [],
            columns: [
                { type: 'selection', align: 'center', width: 60 },
                { title: '序号', type: 'index', align: 'center', width: 80 },
                { title: '所属分类', key: 'field1', align: 'center' },
                { title: '题干', key: 'field2', align: 'center' },
                { title: '题型', key: 'field3', align: 'center' },
                { title: '分值', key: 'field4', align: 'center' },
                { title: '创建人', key: 'field5', align: 'center' },
                { title: '创建时间', key: 'field6', align: 'center' }
            ],
            params: {
                total: 0,
                pageNum: 1,
                pageSize: 10,
                type1: ''
            }
        }
    },
    created () {
        this.queryList()
    },
    methods: {
        search () {
            this.params.pageNum = 1
            this.queryList()
        },
        queryList () {
            // 获取试题列表接口
            questionList(params).then((res) => {
                console.log(res)
                this.list = res.data.data.list
                this.params.pageNum = res.data.data.pageNum
                this.params.pageSize = res.data.data.pageSize
                this.params.total = res.data.data.total
            })
        },
        clearSearch () {}
    }
}
</script>
<style lang="less" scoped>
.paper-mamual {
    border: 1px solid #eee;
    padding: 10px 0;
    &--header {
        padding: 0 10px;
        font-size: 14px;
        margin-bottom: 10px;
        span + span {
            margin-left: 20px;
        }
    }
    &--content {
        padding: 0 10px;
    }
}
</style>
